<template>
  <div>
    <template v-for="(item, index) in (options || innerOptions)">
      <template v-if="values.includes(item.value)">
        <span
          v-if="item.raw.listClass == 'default' || item.raw.listClass == ''"
          :key="item.value"
          :index="index"
          :class="item.raw.cssClass"
        >{{ item.label }}</span
        >
        <el-tag
          v-else
          :disable-transitions="true"
          :key="item.value"
          :index="index"
          :type="item.raw.listClass == 'primary' ? '' : item.raw.listClass"
          :class="item.raw.cssClass"
        >
          {{ item.label }} <span v-html=""></span>
        </el-tag>
      </template>
    </template>
  </div>
</template>

<script>
export default {
  name: "MultipleDictTag",
  props: {
    options: {
      type: Array,
      default: null,
    },
    dictType: String,
    value: [Number, String, Array],
  },
  data() {
    return {
      innerOptions: [],
    }
  },
  methods: {
    onDictReady() {
      this.innerOptions = this.dict.type[this.dictType]
      this.values = this.value.split(",")
    }
  },
  beforeCreate() {
    let dictType = this.$options.propsData.dictType;
    if (dictType) {
      this.$options.dicts = [dictType];
    }
  },

};
</script>
<style scoped lang="scss">
.el-tag + .el-tag {
  margin-left: 10px;
}
</style>
